/**
 * 游戏事件管理器
 * @Author: lzmxqh  
 * @Date: 2022-10-23 16:34:03  
 * @Last Modified by:   lzmxqh  
 * @Last Modified time: 2022-10-23 16:34:03  
 */
export class EventMgr extends Phaser.Events.EventEmitter {

    private static inst: EventMgr;

    public static getInst(): EventMgr {
        EventMgr.inst = EventMgr.inst || new EventMgr();
        return EventMgr.inst;
    }

    /**发送事件 */
    public emit(event: string | symbol, ...args: any[]): boolean {
        return super.emit(event, ...args);
    }

    /**监听事件 */
    public on(event: string | symbol, fn: Function, context?: any): this {
        return super.on(event, fn, context);
    }

    /**移除事件 */
    public off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this {
        return super.off(event, fn, context, once);
    }
}